<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>透明度</title>
    <style>
        .opacity {
            width: 500px;
            height: 500px;
            margin: 0 auto;
            background-color: teal;
        }
        .ul1 {
            background-color: thistle;

            animation-name: move;
            animation-timing-function:linear;
            animation-duration:3s;
            animation-fill-mode: backwards;
            animation-iteration-count: 2;
            animation-direction: alternate;
        }
        @keyframes move {
            from {
                opacity: 0;
            }
            to {
                opacity: 1;
            }
        }
    </style>
</head>
<body>
    <div class="opacity">
        <ul class="ul1">
            <li class="li1">hhh</li>
            <li>xxx</li>
        </ul>
    </div>
</body>
</html>